Skip to content

fix: store new_contributor parameter in __init__#407

Merged
zkoppert merged 3 commits intomainfrom
fix-new-contributor-init
Mar 11, 2026
Merged

fix: store new_contributor parameter in __init__#407
zkoppert merged 3 commits intomainfrom
fix-new-contributor-init

Conversation

@zkoppert
Copy link
Collaborator

Summary

Remove the unconditional new_contributor = False reassignment in ContributorStats.__init__ that caused the constructor parameter to be silently ignored.

Problem

The new_contributor parameter passed to ContributorStats.__init__ was immediately overwritten by new_contributor = False on line 51, making the parameter misleading and preventing callers from initializing instances with a known value.

Fix

Remove the reassignment so self.new_contributor stores the passed-in value (which defaults to False).

Closes #406

Remove the unconditional reassignment of new_contributor = False that
caused the constructor parameter to be silently ignored.

Closes #406

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions bot added the fix label Feb 24, 2026
@zkoppert zkoppert self-assigned this Feb 24, 2026
@zkoppert zkoppert marked this pull request as ready for review February 24, 2026 22:43
@zkoppert zkoppert requested a review from jmeridth as a code owner February 24, 2026 22:43
Copilot AI review requested due to automatic review settings February 24, 2026 22:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes ContributorStats.__init__ so the new_contributor constructor argument is no longer unconditionally overwritten, allowing callers to initialize the instance with the intended value (per #406).

Changes:

  • Removed the unconditional new_contributor = False reassignment inside ContributorStats.__init__.

zkoppert and others added 2 commits March 10, 2026 23:06
- Move new_contributor param to end of __init__ with default=False
- Remove redundant False args from all call sites
- Add test_init_new_contributor_true regression test

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@zkoppert zkoppert merged commit e2065bc into main Mar 11, 2026
34 checks passed
@zkoppert zkoppert deleted the fix-new-contributor-init branch March 11, 2026 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ContributorStats.__init__ ignores new_contributor parameter

3 participants